import request from '@/utils/request'

// 示例接口
export function getMenuList() {
  return request({
    url: '/menu/getUserMenu', // 实际请求路径为 localhost:8080/user/login
    method: 'get',
  })
}
// 获取
export function getAllMenus() {
    return request({
      url: '/SuperAdmin/getMenuTree',
      method: 'get'
    })
  }


// 获取所有菜单(管理员用)
export function getMenuTree() {
  return request({
    url: '/SuperAdmin/getMenuTree',
    method: 'get'
  })
}

// 添加菜单
export function addMenu(data: any) {
  return request({
    url: '/SuperAdmin',
    method: 'post',
    data
  })
}

// 更新菜单
export function updateMenu(data: any) {
  return request({
    url: '/SuperAdmin',
    method: 'put',
    data
  })
}

// 删除菜单
export function deleteMenu(menuId: number) {
  return request({
    url: `/SuperAdmin/${menuId}`,
    method: 'delete'
  })
}